#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include"vector.h"
using namespace std;

void test_vector1()
{
	vector<int> v1;
	vector<int> v2(10, 1);
	vector<int> v3(++v2.begin(), --v2.end());

	/*for (size_t i = 0; i < v2.size(); i++)
	{
		cout << v2[i] << " ";
	}
	cout << endl;

	vector<int>::iterator it = v2.begin();
	while (it != v2.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;

	for (auto e : v2)
	{
		cout << e << " ";
	}
	cout << endl;*/

	v2.resize(15, 2);
	for (auto e : v2)
	{
		cout << e << " ";
	}
	cout << endl;

	v2.resize(20, 3);
	for (auto e : v2)
	{
		cout << e << " ";
	}
	cout << endl;
	
	v2.resize(5);
	for (auto e : v2)
	{
		cout << e << " ";
	}
	cout << endl;


}

void test_vector2()
{
	vector<int> v(10, 1);
	v.push_back(2);
	v.insert(v.begin() + 1, 2);
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;
}

void test_vector3()
{
	vector<string> v;
	v.push_back("aaaaaa");
	v.push_back("bbbbbb");

	vector<int> v1(10, 1);
	vector<vector<int>> vv(10,v1);
	vv[2][1] = 2;
	for (size_t i = 0; i < vv.size(); i++)
	{
		for (size_t j = 0; j < vv[i].size(); j++)
		{
			cout << vv[i][j] << " ";
		}
		cout << endl;
	}
}

int main()
{
	x::test_vector5();
	return 0;
}